class basicPlayer extends basicTop {
	public constructor() {
		super();
	}
	public init() {
		this.isAI = false;
	}
	//获取玩家摇杆的角度
	//每次摇杆事件更改摇杆方向
	public setRoleDir(dir) {
		this.dataTargetDir.setTo(dir.x, dir.y);
		//console.log("dir"+dir.x+".."+dir.y);
	}




	/**更改本人的狀態 */
	public updateMyState() {
		this.updateFace();

		if (this.myStates.state == TopState.normal)
			return;

		let diftime = Date.now() - this.myStates.statesStartTime;

		//更改状态
		if (diftime > this.getStatesTime(this.myStates.state)) {



			this.resetTopStates();

		}
		else {

			if (this.myStates.state == TopState.bePk) {
				if (this.PKObj != null) {
					//创建一下点击次数
					let kickTimes = this.m_gameLogic.getGameScene().getPKClickNum();
					console.log("kickTimes" + kickTimes)
					//判斷一下兩個人是否有人死了
					if (this.PKObj.getPkValue() <= 0) {
						this.PKObj.death();
						this.changeStates(TopState.normal);

						if (!this.isAI || !this.PKObj.isAI) {
							let gamescene = this.m_gameLogic.getGameScene();
							gamescene.sendPKOrder(ShootControlState.normal);

						}
						return;
					}




					this.PKObj.changePkValue(-1 * kickTimes);
				}
			}

		}


	}
}
